home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / util / moni / Scout-src.lha / netinclude / net / if.h < prev    next >
C/C++ Source or Header  |  2002-09-16  |  3KB  |  93 lines

  1. #ifndef NET_IF_H
  2. #define NET_IF_H \
  3.        "$Id: if.h,v 1.1.1.1 2001/11/26 22:21:14 tboeckel Exp $"
  4. /*
  5.  *      Network interface definitions
  6.  *
  7.  *      Copyright © 1994 AmiTCP/IP Group,
  8.  *                       Network Solutions Development, Inc.
  9.  *                       All rights reserved.
  10.  */
  11.  
  12.  
  13. /*
  14.  * Interface request structure used for socket
  15.  * ioctl's.  All interface ioctl's must have parameter
  16.  * definitions which begin with ifr_name.  The
  17.  * remainder may be interface specific.
  18.  */
  19. struct    ifreq {
  20. #define    IFNAMSIZ    16
  21.     char    ifr_name[IFNAMSIZ];        /* if name, e.g. "en0" */
  22.     union {
  23.         struct    sockaddr ifru_addr;
  24.         struct    sockaddr ifru_dstaddr;
  25.         struct    sockaddr ifru_broadaddr;
  26.         short    ifru_flags;
  27.         int    ifru_metric;
  28.         int    ifru_mtu;
  29.         caddr_t    ifru_data;
  30.     } ifr_ifru;
  31. #define    ifr_addr    ifr_ifru.ifru_addr    /* address */
  32. #define    ifr_dstaddr    ifr_ifru.ifru_dstaddr    /* other end of p-to-p link */
  33. #define    ifr_broadaddr    ifr_ifru.ifru_broadaddr    /* broadcast address */
  34. #define    ifr_flags    ifr_ifru.ifru_flags    /* flags */
  35. #define    ifr_metric    ifr_ifru.ifru_metric    /* metric */
  36. #define    ifr_mtu        ifr_ifru.ifru_mtu    /* mtu */
  37. #define    ifr_data    ifr_ifru.ifru_data    /* for use by interface */
  38. };
  39.  
  40. struct ifaliasreq {
  41.     char    ifra_name[IFNAMSIZ];        /* if name, e.g. "en0" */
  42.     struct    sockaddr ifra_addr;
  43.     struct    sockaddr ifra_broadaddr;
  44.     struct    sockaddr ifra_mask;
  45. };
  46.  
  47. /*
  48.  * Structure used in SIOCGIFCONF request.
  49.  * Used to retrieve interface configuration
  50.  * for machine (useful for programs which
  51.  * must know all networks accessible).
  52.  */
  53. struct    ifconf {
  54.     int    ifc_len;        /* size of associated buffer */
  55.     union {
  56.         caddr_t    ifcu_buf;
  57.         struct    ifreq *ifcu_req;
  58.     } ifc_ifcu;
  59. #define    ifc_buf    ifc_ifcu.ifcu_buf    /* buffer address */
  60. #define    ifc_req    ifc_ifcu.ifcu_req    /* array of structures returned */
  61. };
  62.  
  63. #define    IFF_UP        0x1        /* interface is up */
  64. #define    IFF_BROADCAST    0x2        /* broadcast address valid */
  65. #define    IFF_DEBUG    0x4        /* turn on debugging */
  66. #define    IFF_LOOPBACK    0x8        /* is a loopback net */
  67. #define    IFF_POINTOPOINT    0x10        /* interface is point-to-point link */
  68. #define    IFF_NOTRAILERS    0x20        /* avoid use of trailers */
  69. #define    IFF_RUNNING    0x40        /* resources allocated */
  70. #define    IFF_NOARP    0x80        /* no address resolution protocol */
  71. #define    IFF_SIMPLEX    0x800        /* can't hear own transmissions */
  72. #define    IFF_LINK0    0x1000        /* per link layer defined bit */
  73. #define    IFF_LINK1    0x2000        /* per link layer defined bit */
  74.  
  75. #define IFF_SANA        0x4000        /* Interface uses Sana-II driver */
  76.  
  77. /* following not supported now, but reserved: */
  78. #define    IFF_PROMISC    0x100        /* receive all packets */
  79. #define    IFF_ALLMULTI    0x200        /* receive all multicast packets */
  80. #define    IFF_OACTIVE    0x400        /* transmission in progress */
  81. #define    IFF_MULTICAST    0x8000        /* supports multicast */
  82.  
  83. /* flags set internally only: */
  84. #define    IFF_CANTCHANGE \
  85.     (IFF_UP|IFF_BROADCAST|IFF_POINTOPOINT|IFF_RUNNING|IFF_OACTIVE|\
  86.      IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_SANA)
  87.  
  88. #ifndef NET_IF_ARP_H
  89. #include <net/if_arp.h>
  90. #endif
  91.  
  92. #endif /* IF_H */
  93.